Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build error for error C2065: 'GetThreadLocale' #247

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

fishjam
Copy link
Contributor

@fishjam fishjam commented Jul 23, 2022

When I try to build sample in vcpkg's download detours code(v4.0.1-2f7d798f9a) , I meet same build error: C2065: 'GetThreadLocale' as #202 and #240 , although there is fix by add #if(WINVER >= 0x0500), but I think it's not best solution now, especially for traceapi( it can not hook GetThreadLocale ).

consider detour src build configuration is D_WIN32_WINNT=0x501 now, so update the samples's build macro to high value, 0x0501(same as source code define macro)

Microsoft Reviewers: Open in CodeFlow

@bgianfo
Copy link
Contributor

bgianfo commented Jul 25, 2022

If you look at the Detours FAQ we explicitly try to maintain compatibility with Windows NT.

If we took this change, we would be breaking that by assuming the minimum Windows API we support is Windows XP? https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170

@bgianfo bgianfo added the needs-author-feedback This issue / or pull request requires author feedback before more action can be taken. label Jul 25, 2022
@sylveon
Copy link
Contributor

sylveon commented Jul 25, 2022

The source code builds with Windows XP as target, and does use APIs introduced in Windows XP, so the idea of Windows NT compat is probably gone already. This just fixes up the samples to also target Windows XP.

@ghost
Copy link

ghost commented Aug 1, 2022

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days.

@bgianfo
Copy link
Contributor

bgianfo commented Aug 15, 2022

The source code builds with Windows XP as target, and does use APIs introduced in Windows XP, so the idea of Windows NT compat is probably gone already. This just fixes up the samples to also target Windows XP.

That's true, I had misremembered the _WIN32_WINNT version src\Makefile specifies.
Thanks for keeping me honest!

@bgianfo bgianfo merged commit 734ac64 into microsoft:master Aug 15, 2022
@fishjam fishjam deleted the fix_C2065_GetThreadLocale branch October 18, 2022 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-author-feedback This issue / or pull request requires author feedback before more action can be taken.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants